]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Name all the timeouts and idles
authorBastien Nocera <hadess@hadess.net>
Thu, 10 Apr 2014 17:26:52 +0000 (19:26 +0200)
committerBastien Nocera <hadess@hadess.net>
Thu, 10 Apr 2014 19:08:16 +0000 (21:08 +0200)
With very uninventive names. Names now, good names later.

https://bugzilla.gnome.org/show_bug.cgi?id=727983

31 files changed:
js/gdm/loginDialog.js
js/gdm/util.js
js/ui/altTab.js
js/ui/animation.js
js/ui/appDisplay.js
js/ui/background.js
js/ui/components/automountManager.js
js/ui/components/telepathyClient.js
js/ui/dash.js
js/ui/dnd.js
js/ui/endSessionDialog.js
js/ui/keyboard.js
js/ui/layout.js
js/ui/lookingGlass.js
js/ui/main.js
js/ui/messageTray.js
js/ui/notificationDaemon.js
js/ui/osdWindow.js
js/ui/overview.js
js/ui/panel.js
js/ui/pointerWatcher.js
js/ui/screenShield.js
js/ui/scripting.js
js/ui/sessionMode.js
js/ui/status/accessibility.js
js/ui/switcherPopup.js
js/ui/viewSelector.js
js/ui/windowManager.js
js/ui/workspace.js
js/ui/workspaceSwitcherPopup.js
js/ui/workspaceThumbnail.js

index 0b8940a3414f16faae2e3a998f52939818d6ae53..e66789d2261ab6d6498d864dffd6ec8e24a8db0e 100644 (file)
@@ -483,7 +483,7 @@ const LoginDialog = new Lang.Class({
     },
 
     _ensureUserListLoaded: function() {
-        if (!this._userManager.is_loaded)
+        if (!this._userManager.is_loaded) {
             this._userManagerLoadedId = this._userManager.connect('notify::is-loaded',
                                                                   Lang.bind(this, function() {
                                                                       if (this._userManager.is_loaded) {
@@ -492,8 +492,10 @@ const LoginDialog = new Lang.Class({
                                                                           this._userManagerLoadedId = 0;
                                                                       }
                                                                   }));
-        else
-            GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
+        } else {
+            let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
+            GLib.Source.set_name_by_id(id, '[gnome-shell] _loadUserList');
+        }
     },
 
     _updateDisableUserList: function() {
@@ -686,10 +688,11 @@ const LoginDialog = new Lang.Class({
                            },
                            onUpdateScope: this,
                            onComplete: function() {
-                               Mainloop.idle_add(Lang.bind(this, function() {
+                               let id = Mainloop.idle_add(Lang.bind(this, function() {
                                    this._greeter.call_start_session_when_ready_sync(serviceName, true, null);
                                    return GLib.SOURCE_REMOVE;
                                }));
+                               GLib.Source.set_name_by_id(id, '[gnome-shell] this._greeter.call_start_session_when_ready_sync');
                            },
                            onCompleteScope: this });
     },
@@ -745,6 +748,7 @@ const LoginDialog = new Lang.Class({
                                                                          hold.release();
                                                                          return GLib.SOURCE_REMOVE;
                                                                      });
+        GLib.Source.set_name_by_id(this._timedLoginIdleTimeOutId, '[gnome-shell] this._timedLoginAnimationTime');
         return hold;
     },
 
index a3329e0014f24c4e0670d14d69fa15877988107e..678b3baa79f71739bc79f14741ffdd8cfa0bf538 100644 (file)
@@ -252,6 +252,7 @@ const ShellUserVerifier = new Lang.Class({
                                                            this._queueMessageTimeout();
                                                            return GLib.SOURCE_REMOVE;
                                                        }));
+        GLib.Source.set_name_by_id(this._messageQueueTimeoutId, '[gnome-shell] this._queueMessageTimeout');
     },
 
     _queueMessage: function(message, messageType) {
index e318375a2e8322486f9d319c576279045ae33021..40fae87c22d39c4c400b88dfb91dd1cc81c1a6d3 100644 (file)
@@ -305,6 +305,7 @@ const AppSwitcherPopup = new Lang.Class({
             this._thumbnailTimeoutId = Mainloop.timeout_add (
                 THUMBNAIL_POPUP_TIME,
                 Lang.bind(this, this._timeoutPopupThumbnails));
+            GLib.Source.set_name_by_id(this._thumbnailTimeoutId, '[gnome-shell] this._timeoutPopupThumbnails');
         }
     },
 
@@ -556,6 +557,7 @@ const AppSwitcher = new Lang.Class({
                                                                             this._mouseTimeOutId = 0;
                                                                             return GLib.SOURCE_REMOVE;
                                                         }));
+            GLib.Source.set_name_by_id(this._mouseTimeOutId, '[gnome-shell] this._enterItem');
         } else
            this._itemEntered(index);
     },
index 54a5e9c436f6266a7405267644fcbe7d21cf1051..91538c2bbe2937bba052154b50a6d8debbdfbca8 100644 (file)
@@ -34,6 +34,7 @@ const Animation = new Lang.Class({
                 this._showFrame(0);
 
             this._timeoutId = Mainloop.timeout_add(this._speed, Lang.bind(this, this._update));
+            GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._update');
         }
 
         this._isPlaying = true;
index 90fac8777931a8f3c6051231038a12cfd8936ec6..b908d1bf683dea8ff01d5c27340c702597457833 100644 (file)
@@ -1402,6 +1402,7 @@ const AppIcon = new Lang.Class({
                     this.popupMenu();
                     return GLib.SOURCE_REMOVE;
                 }));
+            GLib.Source.set_name_by_id(this._menuTimeoutId, '[gnome-shell] this.popupMenu');
         } else if (button == 3) {
             this.popupMenu();
             return Clutter.EVENT_STOP;
index d36aeb10332733f2b2e339c24bc1453c1e46d9fc..284c4882ba534c6967a607fcb3f57d58fa81fef3 100644 (file)
@@ -271,10 +271,11 @@ const BackgroundCache = new Lang.Class({
 
         if (this._animationFilename == params.filename) {
             if (params.onLoaded) {
-                GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
+                let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
                     params.onLoaded(this._animation);
                     return GLib.SOURCE_REMOVE;
                 }));
+                GLib.Source.set_name_by_id(id, '[gnome-shell] params.onLoaded');
             }
         }
 
@@ -286,10 +287,11 @@ const BackgroundCache = new Lang.Class({
                            this._animation = animation;
 
                            if (params.onLoaded) {
-                               GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
+                               let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
                                    params.onLoaded(this._animation);
                                    return GLib.SOURCE_REMOVE;
                                }));
+                               GLib.Source.set_name_by_id(id, '[gnome-shell] params.onLoaded');
                            }
                        }));
     }
@@ -386,10 +388,11 @@ const Background = new Lang.Class({
 
         this.isLoaded = true;
 
-        GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
+        let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
             this.emit('loaded');
             return GLib.SOURCE_REMOVE;
         }));
+        GLib.Source.set_name_by_id(id, '[gnome-shell] this.emit');
     },
 
     _loadPattern: function() {
@@ -532,6 +535,7 @@ const Background = new Lang.Class({
                                                                     this._updateAnimation();
                                                                     return GLib.SOURCE_REMOVE;
                                                                 }));
+        GLib.Source.set_name_by_id(this._updateAnimationTimeoutId, '[gnome-shell] this._updateAnimation');
     },
 
     _loadAnimation: function(filename) {
index 64b745e8e8f5b1401e61817ee1249284ad5bf864..531d59dc9e66d37f7db8f581b3258b0c263f9634 100644 (file)
@@ -43,6 +43,7 @@ const AutomountManager = new Lang.Class({
         this._driveEjectButtonId = this._volumeMonitor.connect('drive-eject-button', Lang.bind(this, this._onDriveEjectButton));
 
         this._mountAllId = Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
+        GLib.Source.set_name_by_id(this._mountAllId, '[gnome-shell] this._startupMountAll');
     },
 
     disable: function() {
@@ -234,10 +235,11 @@ const AutomountManager = new Lang.Class({
     },
 
     _allowAutorunExpire: function(volume) {
-        Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() {
+        let id = Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() {
             volume.allowAutorun = false;
             return GLib.SOURCE_REMOVE;
         });
+        GLib.Source.set_name_by_id(id, '[gnome-shell] volume.allowAutorun');
     }
 });
 const Component = AutomountManager;
index 49f1e3e1ea516743294a21c00972221be2cfb33a..c42f58eb0c8275bd6be42b143486869f4855dddd 100644 (file)
@@ -681,6 +681,7 @@ const ChatSource = new Lang.Class({
             Mainloop.source_remove(this._notifyTimeoutId);
         this._notifyTimeoutId = Mainloop.timeout_add(500,
             Lang.bind(this, this._notifyTimeout));
+        GLib.Source.set_name_by_id(this._notifyTimeoutId, '[gnome-shell] this._notifyTimeout');
     },
 
     _notifyTimeout: function() {
@@ -924,14 +925,16 @@ const ChatNotification = new Lang.Class({
                                 realMessage: group != 'meta' });
 
         if (!props.noTimestamp) {
-            if (timestamp < currentTime - SCROLLBACK_IMMEDIATE_TIME)
+            if (timestamp < currentTime - SCROLLBACK_IMMEDIATE_TIME) {
                 this.appendTimestamp();
-            else
+            } else {
                 // Schedule a new timestamp in SCROLLBACK_IMMEDIATE_TIME
                 // from the timestamp of the message.
                 this._timestampTimeoutId = Mainloop.timeout_add_seconds(
                     SCROLLBACK_IMMEDIATE_TIME - (currentTime - timestamp),
                     Lang.bind(this, this.appendTimestamp));
+                GLib.Source.set_name_by_id(this._timestampTimeoutId, '[gnome-shell] this.appendTimestamp');
+            }
         }
 
         this._filterMessages();
@@ -1100,6 +1103,7 @@ const ChatNotification = new Lang.Class({
             this._composingTimeoutId = Mainloop.timeout_add_seconds(
                 COMPOSING_STOP_TIMEOUT,
                 Lang.bind(this, this._composingStopTimeout));
+            GLib.Source.set_name_by_id(this._composingTimeoutId, '[gnome-shell] this._composingStopTimeout');
         } else {
             this.source.setChatState(Tp.ChannelChatState.ACTIVE);
         }
index 0d5db8e8bba7de850cbef6f777a7ee76ccf579ba..99635cd445579b66f8352883af4e47bf66fdbcd0 100644 (file)
@@ -582,6 +582,7 @@ const Dash = new Lang.Class({
                         this._showLabelTimeoutId = 0;
                         return GLib.SOURCE_REMOVE;
                     }));
+                GLib.Source.set_name_by_id(this._showLabelTimeoutId, '[gnome-shell] item.showLabel');
                 if (this._resetHoverTimeoutId > 0) {
                     Mainloop.source_remove(this._resetHoverTimeoutId);
                     this._resetHoverTimeoutId = 0;
@@ -599,6 +600,7 @@ const Dash = new Lang.Class({
                         this._resetHoverTimeoutId = 0;
                         return GLib.SOURCE_REMOVE;
                     }));
+                GLib.Source.set_name_by_id(this._resetHoverTimeoutId, '[gnome-shell] this._labelShowing');
             }
         }
     },
index a99791efdbea98e77ef513c8b25cf04f5977fc88..2b872419cf4dc87ef91735671d97e7a8078c055f 100644 (file)
@@ -395,6 +395,7 @@ const _Draggable = new Lang.Class({
 
         this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT,
                                             Lang.bind(this, this._updateDragHover));
+        GLib.Source.set_name_by_id(this._updateHoverId, '[gnome-shell] this._updateDragHover');
     },
 
     _updateDragPosition : function (event) {
index a7a678f099e51fbb285104f20aadb60f156cfe26..7222f6eebae2a6cbc1dc7966b326c118057099e8 100644 (file)
@@ -551,6 +551,7 @@ const EndSessionDialog = new Lang.Class({
 
                 return GLib.SOURCE_REMOVE;
             }));
+        GLib.Source.set_name_by_id(this._timerId, '[gnome-shell] this._confirm');
     },
 
     _stopTimer: function() {
index c1a6dbfa20a816be34b7c7ca5ae94337bc4a92a3..62147c751818a1cd83bc340185fc71f2758c554b 100644 (file)
@@ -266,12 +266,14 @@ const Keyboard = new Lang.Class({
             return;
         }
 
-        if (!this._showIdleId)
-            this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE,
-                                             Lang.bind(this, function() {
-                                                 this.Show(time);
-                                                 return GLib.SOURCE_REMOVE;
-                                             }));
+        if (!this._showIdleId) {
+          this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE,
+                                           Lang.bind(this, function() {
+                                               this.Show(time);
+                                               return GLib.SOURCE_REMOVE;
+                                           }));
+          GLib.Source.set_name_by_id(this._showIdleId, '[gnome-shell] this.Show');
+        }
     },
 
     _createLayersForGroup: function (gname) {
@@ -500,6 +502,7 @@ const Keyboard = new Lang.Class({
                                                        this._show(monitor);
                                                        return GLib.SOURCE_REMOVE;
                                                    }));
+        GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
     },
 
     _show: function(monitor) {
@@ -526,6 +529,7 @@ const Keyboard = new Lang.Class({
                                                        this._hide();
                                                        return GLib.SOURCE_REMOVE;
                                                    }));
+        GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
     },
 
     _hide: function() {
index dc91f02df7e98f07ba4170a0143a54a7d343cdc0..3901c9f473b20b713f1f55798dbf3264d0553b7f 100644 (file)
@@ -628,10 +628,11 @@ const LayoutManager = new Lang.Class({
         // until the event loop is uncontended and idle.
         // This helps to prevent us from running the animation
         // when the system is bogged down
-        GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() {
+        let id = GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() {
             this._startupAnimation();
             return GLib.SOURCE_REMOVE;
         }));
+        GLib.Source.set_name_by_id(id, '[gnome-shell] this._startupAnimation');
     },
 
     _startupAnimation: function() {
index 9c2966a60dfa69395edf5fc5badd98891fa07585..2dccc99294807f69f4aef78133933806ce5d4e42 100644 (file)
@@ -846,6 +846,7 @@ const LookingGlass = new Lang.Class({
                 Mainloop.source_remove(this._timeoutId);
                 return GLib.SOURCE_REMOVE;
            }));
+           GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] gcIcon.icon_name = \'gnome-fs-trash-full\'');
            return Clutter.EVENT_PROPAGATE;
         }));
 
index bf80bc023002c7cb9a879e8b6a2379af5419d5fa..bf2540102f226968e403a3e6315488976aa2f592 100644 (file)
@@ -608,5 +608,6 @@ function queueDeferredWork(workId) {
             _deferredTimeoutId = 0;
             return GLib.SOURCE_REMOVE;
         });
+        GLib.Source.set_name_by_id(_deferredTimeoutId, '[gnome-shell] _runAllDeferredWork');
     }
 }
index 70b6fc3451a351e994b9666bb1468489a45e4954..891bab2a4de09ee0cd32bf9cf79d0f80aa9d2ec0 100644 (file)
@@ -1987,6 +1987,7 @@ const MessageTray = new Lang.Class({
 
                 this._trayDwellTimeoutId = Mainloop.timeout_add(TRAY_DWELL_TIME,
                                                                 Lang.bind(this, this._trayDwellTimeout));
+                GLib.Source.set_name_by_id(this._trayDwellTimeoutId, '[gnome-shell] this._trayDwellTimeout');
             }
             this._trayDwelling = true;
         } else {
@@ -2316,6 +2317,7 @@ const MessageTray = new Lang.Class({
             // That gives the user more time to mouse away from the notification and mouse back in in order to expand it.
             let timeout = this._useLongerNotificationLeftTimeout ? LONGER_HIDE_TIMEOUT * 1000 : HIDE_TIMEOUT * 1000;
             this._notificationLeftTimeoutId = Mainloop.timeout_add(timeout, Lang.bind(this, this._onNotificationLeftTimeout));
+            GLib.Source.set_name_by_id(this._notificationLeftTimeoutId, '[gnome-shell] this._onNotificationLeftTimeout');
         }
     },
 
@@ -2351,6 +2353,7 @@ const MessageTray = new Lang.Class({
             this._notificationLeftMouseX = -1;
             this._notificationLeftTimeoutId = Mainloop.timeout_add(LONGER_HIDE_TIMEOUT * 1000,
                                                              Lang.bind(this, this._onNotificationLeftTimeout));
+            GLib.Source.set_name_by_id(this._notificationLeftTimeoutId, '[gnome-shell] this._onNotificationLeftTimeout');
         } else {
             this._notificationLeftTimeoutId = 0;
             this._useLongerNotificationLeftTimeout = false;
@@ -2668,10 +2671,12 @@ const MessageTray = new Lang.Class({
             Mainloop.source_remove(this._notificationTimeoutId);
             this._notificationTimeoutId = 0;
         }
-        if (timeout > 0)
+        if (timeout > 0) {
             this._notificationTimeoutId =
                 Mainloop.timeout_add(timeout,
                                      Lang.bind(this, this._notificationTimeout));
+            GLib.Source.set_name_by_id(this._notificationTimeoutId, '[gnome-shell] this._notificationTimeout');
+        }
     },
 
     _notificationTimeout: function() {
index 46107808e3b32cbd2cd0093ce1720924a86761c1..dd25661179e8cce90a0972134b0ac024327eeba9 100644 (file)
@@ -244,11 +244,12 @@ const FdoNotificationDaemon = new Lang.Class({
             // Ignore replacesId since we already sent back a
             // NotificationClosed for that id.
             id = this._nextNotificationId++;
-            Mainloop.idle_add(Lang.bind(this,
-                                        function () {
-                                            this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED);
-                                            return GLib.SOURCE_REMOVE;
-                                        }));
+            let idle_id = Mainloop.idle_add(Lang.bind(this,
+                                            function () {
+                                                this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED);
+                                                return GLib.SOURCE_REMOVE;
+                                            }));
+            GLib.Source.set_name_by_id(idle_id, '[gnome-shell] this._emitNotificationClosed');
             return invocation.return_value(GLib.Variant.new('(u)', [id]));
         }
 
index c9cb77d78a129e372d861f0372f1bad0e195ab5c..2513aa8435842679fbd5bcf38068d49981a5f842 100644 (file)
@@ -156,6 +156,7 @@ const OsdWindow = new Lang.Class({
             Mainloop.source_remove(this._hideTimeoutId);
         this._hideTimeoutId = Mainloop.timeout_add(HIDE_TIMEOUT,
                                                    Lang.bind(this, this._hide));
+        GLib.Source.set_name_by_id(this._hideTimeoutId, '[gnome-shell] this._hide');
     },
 
     cancel: function() {
index a60a966af72582b2e6cbbf549d049a44e2da01e2..5e000cd90688590bf4aa14abfdc58839acc92e4e 100644 (file)
@@ -365,6 +365,7 @@ const Overview = new Lang.Class({
                                                 this._lastHoveredWindow = null;
                                                 return GLib.SOURCE_REMOVE;
                                             }));
+            GLib.Source.set_name_by_id(this._windowSwitchTimeoutId, '[gnome-shell] Main.activateWindow');
         }
 
         return DND.DragMotionResult.CONTINUE;
index e7f8df92a315539b7c3fc55c4d74e8bfd5efd52d..750149e58ea27fbc5580a67509ba60e920277da6 100644 (file)
@@ -595,6 +595,7 @@ const ActivitiesButton = new Lang.Class({
             Mainloop.source_remove(this._xdndTimeOut);
         this._xdndTimeOut = Mainloop.timeout_add(BUTTON_DND_ACTIVATION_TIMEOUT,
                                                  Lang.bind(this, this._xdndToggleOverview, actor));
+        GLib.Source.set_name_by_id(this._xdndTimeOut, '[gnome-shell] this._xdndToggleOverview');
 
         return DND.DragMotionResult.CONTINUE;
     },
index 5eb6718bdbef81fbd6a6b5d7ac6b7817f4a30c02..c59d7412861655393e1a4b3b04c8f77943e8b68c 100644 (file)
@@ -107,6 +107,7 @@ const PointerWatcher = new Lang.Class({
 
         this._timeoutId = Mainloop.timeout_add(minInterval,
                                                Lang.bind(this, this._onTimeout));
+        GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
     },
 
     _onTimeout: function() {
index 90642a6c85c0938508e84e89beb79de9f64129af..02098468358577408830263f936a0cf8980411a9 100644 (file)
@@ -850,6 +850,7 @@ const ScreenShield = new Lang.Class({
                                                            this.lock(false);
                                                            return GLib.SOURCE_REMOVE;
                                                        }));
+            GLib.Source.set_name_by_id(this._lockTimeoutId, '[gnome-shell] this.lock');
         }
 
         this._activateFade(this._longLightbox, STANDARD_FADE_TIME);
@@ -1041,6 +1042,7 @@ const ScreenShield = new Lang.Class({
 
         if (!this._arrowAnimationId) {
             this._arrowAnimationId = Mainloop.timeout_add(6000, Lang.bind(this, this._animateArrows));
+            GLib.Source.set_name_by_id(this._arrowAnimationId, '[gnome-shell] this._animateArrows');
             this._animateArrows();
         }
 
@@ -1108,10 +1110,11 @@ const ScreenShield = new Lang.Class({
         if (params.fadeToBlack && params.animateFade) {
             // Take a beat
 
-            Mainloop.timeout_add(1000 * MANUAL_FADE_TIME, Lang.bind(this, function() {
+            let id = Mainloop.timeout_add(1000 * MANUAL_FADE_TIME, Lang.bind(this, function() {
                 this._activateFade(this._shortLightbox, MANUAL_FADE_TIME);
                 return GLib.SOURCE_REMOVE;
             }));
+            GLib.Source.set_name_by_id(id, '[gnome-shell] this._activateFade');
         } else {
             if (params.fadeToBlack)
                 this._activateFade(this._shortLightbox, 0);
index 8c8e3a34a979342b2dfd480548e3e2c665c3a9cb..1da99d9775182de6e744d3e02f244cfb86da6043 100644 (file)
@@ -39,11 +39,12 @@ const Main = imports.ui.main;
 function sleep(milliseconds) {
     let cb;
 
-    Mainloop.timeout_add(milliseconds, function() {
+    let id = Mainloop.timeout_add(milliseconds, function() {
                              if (cb)
                                  cb();
                              return GLib.SOURCE_REMOVE;
                          });
+    GLib.Source.set_name_by_id(id, '[gnome-shell] sleep');
 
     return function(callback) {
         cb = callback;
index 599b51cfdc819d5b12b456033f49d9b21d3f11d6..d547cb85019c0c27485d3ee7cd3c0bd1ed9416c3 100644 (file)
@@ -140,13 +140,14 @@ function _loadModes() {
 
 function listModes() {
     _loadModes();
-    Mainloop.idle_add(function() {
+    let id = Mainloop.idle_add(function() {
         let names = Object.getOwnPropertyNames(_modes);
         for (let i = 0; i < names.length; i++)
             if (_modes[names[i]].isPrimary)
                 print(names[i]);
         Mainloop.quit('listModes');
     });
+    GLib.Source.set_name_by_id(id, '[gnome-shell] listModes');
     Mainloop.run('listModes');
 }
 
index 56f821180149e2ae1def1f21f40eb3d86e6ae6ca..efcb6526712b8468a894faaf81ef17a21b270382 100644 (file)
@@ -103,6 +103,7 @@ const ATIndicator = new Lang.Class({
             return;
 
         this._syncMenuVisbilityIdle = Mainloop.idle_add(Lang.bind(this, this._syncMenuVisibility));
+        GLib.Source.set_name_by_id(this._syncMenuVisbilityIdle, '[gnome-shell] this._syncMenuVisibility');
     },
 
     _buildItemExtended: function(string, initial_value, writable, on_set) {
index 176bc6abac22d7efd42156e90191099d1c0199c7..bd7875f8d87804dd17e837f61b5b068b08707c2a 100644 (file)
@@ -166,6 +166,7 @@ const SwitcherPopup = new Lang.Class({
                                                                this._initialDelayTimeoutId = 0;
                                                                return GLib.SOURCE_REMOVE;
                                                            }));
+        GLib.Source.set_name_by_id(this._initialDelayTimeoutId, '[gnome-shell] Main.osdWindow.cancel');
         return true;
     },
 
@@ -250,6 +251,7 @@ const SwitcherPopup = new Lang.Class({
             Mainloop.source_remove(this._motionTimeoutId);
 
         this._motionTimeoutId = Mainloop.timeout_add(DISABLE_HOVER_TIMEOUT, Lang.bind(this, this._mouseTimedOut));
+        GLib.Source.set_name_by_id(this._motionTimeoutId, '[gnome-shell] this._mouseTimedOut');
     },
 
     _mouseTimedOut: function() {
index 79fcde6c56567e8864be8eab1356f6c33d56ba57..7dacc47bc0d90c00c51ad8f64f96028b4b142ac4 100644 (file)
@@ -383,9 +383,11 @@ const ViewSelector = new Lang.Class({
                 this._iconClickedId = this._entry.connect('secondary-icon-clicked',
                     Lang.bind(this, this.reset));
 
-            if (this._searchTimeoutId == 0)
+            if (this._searchTimeoutId == 0) {
                 this._searchTimeoutId = Mainloop.timeout_add(150,
                     Lang.bind(this, this._doSearch));
+                GLib.Source.set_name_by_id(this._searchTimeoutId, '[gnome-shell] this._doSearch');
+            }
         } else {
             if (this._iconClickedId > 0) {
                 this._entry.disconnect(this._iconClickedId);
index bdf61777978ee774a3007264978d63501282c9fc..bc43388b5619c1d6df4b71c1ac63ae116ee00fbe 100644 (file)
@@ -82,6 +82,7 @@ const DisplayChangeDialog = new Lang.Class({
                                         { expand: false, x_fill: false, x_align: St.Align.END });
 
         this._timeoutId = Mainloop.timeout_add(ONE_SECOND, Lang.bind(this, this._tick));
+        GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._tick');
     },
 
     close: function(timestamp) {
@@ -271,18 +272,20 @@ const WorkspaceTracker = new Lang.Class({
             this._queueCheckWorkspaces();
             return GLib.SOURCE_REMOVE;
         }));
+        GLib.Source.set_name_by_id(workspace._keepAliveId, '[gnome-shell] this._queueCheckWorkspaces');
     },
 
     _windowRemoved: function(workspace, window) {
         workspace._lastRemovedWindow = window;
         this._queueCheckWorkspaces();
-        Mainloop.timeout_add(LAST_WINDOW_GRACE_TIME, Lang.bind(this, function() {
+        let id = Mainloop.timeout_add(LAST_WINDOW_GRACE_TIME, Lang.bind(this, function() {
             if (workspace._lastRemovedWindow == window) {
                 workspace._lastRemovedWindow = null;
                 this._queueCheckWorkspaces();
             }
             return GLib.SOURCE_REMOVE;
         }));
+        GLib.Source.set_name_by_id(id, '[gnome-shell] this._queueCheckWorkspaces');
     },
 
     _windowLeftMonitor: function(metaScreen, monitorIndex, metaWin) {
index f2521c639b56741b8db1ae2919c377ae708536b3..2c49d6096aa405cf796ef8c16025650797e5a6fe 100644 (file)
@@ -594,11 +594,12 @@ const WindowOverlay = new Lang.Class({
 
             // use an idle handler to avoid mapping problems -
             // see comment in Workspace._windowAdded
-            Mainloop.idle_add(Lang.bind(this,
-                                        function() {
-                                            this._windowClone.emit('selected');
-                                            return GLib.SOURCE_REMOVE;
-                                        }));
+            let id = Mainloop.idle_add(Lang.bind(this,
+                                            function() {
+                                                this._windowClone.emit('selected');
+                                                return GLib.SOURCE_REMOVE;
+                                            }));
+            GLib.Source.set_name_by_id(id, '[gnome-shell] this._windowClone.emit');
         }
     },
 
@@ -669,8 +670,10 @@ const WindowOverlay = new Lang.Class({
     },
 
     _onLeave: function() {
-        if (this._idleToggleCloseId == 0)
+        if (this._idleToggleCloseId == 0) {
             this._idleToggleCloseId = Mainloop.timeout_add(750, Lang.bind(this, this._idleToggleCloseButton));
+            GLib.Source.set_name_by_id(this._idleToggleCloseId, '[gnome-shell] this._idleToggleCloseButton');
+        }
         return Clutter.EVENT_PROPAGATE;
     },
 
@@ -1418,6 +1421,7 @@ const Workspace = new Lang.Class({
         this._currentLayout = null;
         this._repositionWindowsId = Mainloop.timeout_add(750,
             Lang.bind(this, this._delayedWindowRepositioning));
+        GLib.Source.set_name_by_id(this._repositionWindowsId, '[gnome-shell] this._delayedWindowRepositioning');
     },
 
     _doAddWindow : function(metaWin) {
@@ -1429,14 +1433,15 @@ const Workspace = new Lang.Class({
         if (!win) {
             // Newly-created windows are added to a workspace before
             // the compositor finds out about them...
-            Mainloop.idle_add(Lang.bind(this,
-                                        function () {
-                                            if (this.actor &&
-                                                metaWin.get_compositor_private() &&
-                                                metaWin.get_workspace() == this.metaWorkspace)
-                                                this._doAddWindow(metaWin);
-                                            return GLib.SOURCE_REMOVE;
-                                        }));
+            let id = Mainloop.idle_add(Lang.bind(this,
+                                            function () {
+                                                if (this.actor &&
+                                                    metaWin.get_compositor_private() &&
+                                                    metaWin.get_workspace() == this.metaWorkspace)
+                                                    this._doAddWindow(metaWin);
+                                                return GLib.SOURCE_REMOVE;
+                                            }));
+            GLib.Source.set_name_by_id(id, '[gnome-shell] this._doAddWindow');
             return;
         }
 
index cf3042192bde19f22782d6a7120197a61a233c0e..55da3e5511fe1f0b8a5c2bd376200eb0c991fdc8 100644 (file)
@@ -52,6 +52,7 @@ const WorkspaceSwitcherPopup = new Lang.Class({
         this._globalSignals.push(global.screen.connect('workspace-removed', Lang.bind(this, this._redisplay)));
 
         this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, Lang.bind(this, this._onTimeout));
+        GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
     },
 
     _getPreferredHeight : function (actor, forWidth, alloc) {
@@ -145,6 +146,7 @@ const WorkspaceSwitcherPopup = new Lang.Class({
         if (this._timeoutId != 0)
             Mainloop.source_remove(this._timeoutId);
         this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, Lang.bind(this, this._onTimeout));
+        GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
         this._show();
     },
 
index 25469e34173823aa2af89caf30f60fd1743007fb..113f2a71bb77c2ef3365d2e410eb3c43ee107f5e 100644 (file)
@@ -386,14 +386,15 @@ const WorkspaceThumbnail = new Lang.Class({
         if (!win) {
             // Newly-created windows are added to a workspace before
             // the compositor finds out about them...
-            Mainloop.idle_add(Lang.bind(this,
-                                        function () {
+            let id = Mainloop.idle_add(Lang.bind(this,
+                                       function () {
                                             if (!this._removed &&
                                                 metaWin.get_compositor_private() &&
                                                 metaWin.get_workspace() == this.metaWorkspace)
                                                 this._doAddWindow(metaWin);
                                             return GLib.SOURCE_REMOVE;
                                         }));
+            GLib.Source.set_name_by_id(id, '[gnome-shell] this._doAddWindow');
             return;
         }